<template>
  这是second：跨组件通信
  <div>使用props通信：{{ props.post.info }}</div>
  <div>使用provide/inject（依赖注入）通信：{{ getTitle }}</div>
  <div>使用provide/inject（依赖注入）通信,但是注入名是symbol：{{ getTitle }}</div>
  <div>使用mitt通信：{{ busName }}</div>
</template>

<script setup>
import { bus } from "@/utils/mitt";
const props = defineProps(["post"]);
const getTitle = inject("sendTitle");
const busName = ref("");
bus.on("titleByBus", e => {
  busName.value = e.value;
});
</script>

<style scoped lang="less">
</style>
